home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
misc
/
emu
/
arosdev.lha
/
AROS
/
test
/
filetest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-24
|
716b
|
35 lines
/*
(C) 1995-96 AROS - The Amiga Replacement OS
$Id: filetest.c,v 1.2 1996/08/01 17:41:39 digulla Exp $
$Log: filetest.c,v $
Revision 1.2 1996/08/01 17:41:39 digulla
Added standard header for all files
Desc:
Lang:
*/
#include <clib/exec_protos.h>
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <stdio.h>
int main(void)
{
BPTR file;
UBYTE buffer[20];
LONG r1=0,r2=0,r3=0,r4=0;
file=Open("testfile",MODE_NEWFILE);
if(file)
{
r1=Write(file,"hello, world\n",13);
r2=Seek(file,0,OFFSET_BEGINNING);
r3=Read(file,buffer,19);
r4=Close(file);
}
if(r3>=0)
buffer[r3]=0;
printf("%ld %ld %ld %ld \'%s\'\n",r1,r2,r3,r4,buffer);
return 0;
}